Run-time algorithm specialisation